
import * as React from 'react';
import { View, Text, Button } from 'react-native';


function SecondPage(props) {
    const { navigation, route } = props;
    const data = route.params != undefined ? route.params.data : null;
    return (
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'space-around' }}>
            {data && <Text>Data from First Page: {data}</Text>}
            <Button
                title="First Page"
                onPress={() => navigation.navigate('FirstPage')}
                color="gray"
            />
            <Button
                title="Third Page"
                onPress={() => navigation.navigate('ThirdPage')}
                color="green"
            />
            <Button
                title="Fourth Page"
                onPress={() => navigation.navigate('FourthPage')}
                color="red"
            />
        </View >

    );
}

export default SecondPage;
